//
//  RABleServiceController.h
//  RayoSmartBleKey
//
//  Created by Piccolo on 2017/7/13.
//  Copyright © 2017年 Piccolo. All rights reserved.
//

/*-- Ble FSU SDK --*/
#import "RAFSUSDKBase.h"
#import "RASimpleFSUSDK.h"
#import "RAGeneralFSUSDK.h"
#import "RAFSUSDKPeripheral.h"

static CGFloat const kScanDurationTime = 10.f;

@protocol RABleServiceControllerDelegate <NSObject>

@optional

/*------All------*/
- (void)scanedPeripheral:(CBPeripheral *)peripheral peripheralName:(NSString *)peripheralName RSSI:(NSNumber *)RSSI;

/*--------- FSU ---------*/


//- (void)scanedPeripheral:(CBPeripheral *)peripheral;
//- (void)currentRssi:(NSNumber *)rssi;
//- (void)activeReport:(NSData *)data;

/*-- Simple FSU SDK Result Info --*/

- (void)simpleFsuRequestInitSdkResultInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestDestroyResultInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestConnectResultInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestDisconnectResultInfo:(RAFSUSDKResultInfo *)info;

- (void)simpleFsuRequestSetOnlineOpenResultInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestSetFsuTimeResultInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestActiveReport:(RAFSUSDKActiveReportInfo *)fsuActiveReportInfo;
- (void)simpleFsuRequestReadFSUEvent:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestCleanFSUEvent:(RAFSUSDKResultInfo *)info;

- (void)simpleFsuRequestReadFSUDeviceID:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestSetFSUDeviceID:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestGetFSUServiceInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestSetFSUServiceInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestGetFSUWirelessInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestSetFSUWirelessInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestGetPPPAddressInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestReadSimCardInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestReadThresholdInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestSetThresholdInfo:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestReadFSUMacAndVerson:(RAFSUSDKResultInfo *)info;
- (void)simpleFsuRequestReadFSUUnvarnishedTransmissionInfo:(RAFSUSDKResultInfo *)info;

/*-- General FSU SDK Result Info --*/

- (void)generalFsuRequestInitSdkResultInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestDestroyResultInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestConnectResultInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestDisconnectResultInfo:(RAFSUSDKResultInfo *)info;

- (void)generalFsuRequestReadFSUDeviceID:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetFSUServiceInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetFSUServiceInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetFSUWirelessInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetFSUWirelessInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetPPPAddressInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetfsuEthernetParameterInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetfsuEthernetParameterInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetfsuHeartBeatInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetTimeInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetTimeInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetMotorActionInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetMotorActionInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetDoParameterInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestGetDoParameterInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetDoActionInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetSystemUpdateInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetRestartInfo:(RAFSUSDKResultInfo *)info;
- (void)generalFsuRequestSetResetInfo:(RAFSUSDKResultInfo *)info;

@end

@interface RABleServiceController : NSObject <RASimpleFSUSDKDelegate, RAGeneralFSUSDKDelegate, CBCentralManagerDelegate>

@property (nonatomic, weak) id delegate;
@property (nonatomic, strong) CBPeripheral *peripheral;
@property (nonatomic, assign) BOOL bluetoothIsOn;
@property (nonatomic, assign, readonly) BOOL isScanning;

+ (instancetype)sharedManager;

- (void)initBleServiceWithDelegate:(id)delegate;

- (void)startScanBle;
- (void)stopScan;
- (void)disconnectBle;
- (CBPeripheralState)currentBleState;

- (void)initSimpleFSUSDK;
- (void)initGeneralFSUSDK;

@end
